

package xib.parserTools.interfaces;

import xib.utils.XibDataException;

/**
 * This interface defined all the functions needed to save properly all the
 * information about the SpeechBubble from the source.
 * @author xavierds
 */
public interface ISpeechBubbleData {

    /**
     * Returns the imageIdentifier for this ISpeechBubbleData.
     * @return a String with this imageIdentifier.
     * @throws XibDataException if the imageIdentifier has not been
     * initialized properly.
     */
    public String getImageIdentifier();

    /**
     * Returns the text for this ISpeechBubbleData.
     * @return A String whith this text.
     */
    public String getText();

    /**
     * Returns the SpeechBubbleType of this ISpeechBubbleData.
     * @return The SpeechBubbleType from this ISpeechBubbleData.
     */
    public SpeechBubbleType getSpeechBubbleType();

    /**
     * Returns the location from the X axis for this ISpeechBubbleData. This
     * location is a relative value and can't be used like an absolute value
     * in the canvas.
     * @return An integer with the location from the X axis.
     */
    public int getLocationX();

    /**
     * Returns the location from the Y axis for this ISpeechBubbleData. This
     * location is a relative value and can't be used like an absolute value
     * in the canvas.
     * @return An integer with the location from the Y axis.
     */
    public int getLocationY();

    /**
     * Returns the width from this ISpeechBubbleData.
     * @return An integer with the width from this ISpeechBubbleData.
     * @throws XibDataException If the width has not been set properly.
     */
    public int getWidth();

    /**
     * Returns the height from this ISpeechBubbleData.
     * @return An integer with the height from this ISpeechBubbleData.
     * @throws XibDataException If the height has not been set properly.
     */
    public int getHeight();

    /**
     * Sets the imageIdentifier of this ISpeechBubbleData from the given String,
     * which can't be null or empty.
     * @param imageIdentifier
     * @throws XibDataException If the given String is null or empty.
     */
    public void setImageIdentifier(String imageIdentifier);

    /**
     * Sets the imageIdentifier of this ISpeechBubbleData from the given String,
     * which can't be null.
     * @param text
     * @throws XibDataException If the given String is null.
     */
    public void setText(String text);

    /**
     * Sets the SpeechBubbleType of this ISpeechBubbleData from the given
     * SpeechBubbleType which can't be null.
     * @param type
     * @throws XibDataException If the given SpeechBubbleType is null.
     */
    public void setSpeechBubbleType(SpeechBubbleType type);

    /**
     * Sets the location from the X and Y axis of this ISpeechBubbleData from
     * the given locations. The locations can not be less than 0.
     * @param x This location is from the X axis.
     * @param y This location is from the Y axis.
     * @throws XibDataException If one of the given locations is less than 0.
     */
    public void setLocationXY(int x, int y);

    /**
     * Sets the width and height of this ISpeechBubbleData from the given values.
     * The width and height can not be less than 1.
     * @param width
     * @param height
     * @throws XibDataException If the width or height is less than 1.
     */
    public void setWidthAndHeight(int width, int height);

    /**
     * Returns true if the data of this ISpeechBubbleData is initialized properly.
     * @return A boolean
     * @throws XibDataException If the imageIdentifier, height or width were not
     * properly initialized.
     */
    public boolean validate();

    /**
     * Enumeration list with the values of the diferents availables types of
     * speechBubble.
     */
    public enum SpeechBubbleType{
        /**
         * Default type of speechBubble this one is for the default language
         * of the file.
         */
        DefaultLanguage,

        /**
         * This speechBubble type is the one is going to be used for all
         * extra languages present in the file.
         */
        OtherLanguage};
}
